*******Climate_MP paper


egen crossid = group( country )
egen timeid = group(period)
xtset crossid timeid
gen lclimate = l.climate
gen l2cpi_food = l2.cpi_food
gen lexc = l.exch
drop lexc 
destring TBR, replace force
destring exch, replace force
gen lexc = l.exch
gen ltbr = l.TBR
gen l2cpi_head = l2.cpi_head
gen lfinf = l2.food_inflation
gen lhinf = l2.head_inflation
ivqregress smooth food_inflation (climate = lclimate), quantile(25 50 75) vce(robust)
ivqregress smooth food_inflation exch (climate = lclimate), quantile(25 50 75) vce(robust)
ivqregress smooth food_inflation exch TBR (climate = lclimate), quantile(25 50 75) vce(robust)
gen lfood = l.food_inflation
ivqregress smooth food_inflation lfood exch TBR (climate = lclimate), quantile(25 50 75) vce(robust)
ivqregress smooth food_inflation lfood exch TBR (climate = lclimate lfinf ), quantile(25 50 75) vce(robust)
ivqregress smooth food_inflation lfood exch TBR (climate = lclimate lexc ), quantile(25 50 75) vce(robust)
ivqregress smooth food_inflation lfood exch TBR (climate = lexc ), quantile(25 50 75) vce(robust)
ivqregress smooth food_inflation lfood TBR (exch climate = lexc lclimate ), quantile(25 50 75) vce(robust)
ivqregress smooth food_inflation lfood exch (climate = lclimate), quantile(25 50 75) vce(robust)
ivqregress smooth food_inflation lfood (climate = lclimate), quantile(25 50 75) vce(robust)


*******Convergence diagnostic plot (at diffferent quantiles)
 estat waldplot,  quantile(.1)
 estat waldplot,  quantile(.25)
  estat waldplot,  quantile(.5)
  estat waldplot,  quantile(.75)
  estat waldplot,  quantile(.90)
  
  
  mmqreg food_inflation climate TBR exch, q(0.1 0.5 0.9)
mmqreg food_inflation climate TBR exch, q(0.1 0.25 0.5 0.75 0.9)
mmqreg head_inflation climate TBR exch, q(0.1 0.25 0.5 0.75 0.9)
mmqreg head_inflation climate TBR exch if climate <1.12, q(0.1 0.25 0.5 0.75 0.9)
mmqreg head_inflation climate TBR exch if climate >1.12, q(0.1 0.25 0.5 0.75 0.9)
mmqreg head_inflation climate TBR exch if climate <1.12, q(0.1 0.25 0.5 0.75 0.9)
outreg2 using subless.doc
shellout using `"subless.doc"'
mmqreg head_inflation climate TBR exch if climate >1.12, q(0.1 0.25 0.5 0.75 0.9)
outreg2 using subgreat.doc
shellout using `"subgreat.doc"'
twoway (scatter food_inflation period ), by (country)
twoway (scatter head_inflation period ), by (country)
twoway (scatter climate period ), by (country)
mmqreg food_inflation climate TBR exch if climate >1.12, q(0.1 0.25 0.5 0.75 0.9)
outreg2 using foodsubgreater.doc
mmqreg food_inflation climate TBR exch if climate <1.12, q(0.1 0.25 0.5 0.75 0.9)
outreg2 using foodsubless.doc
shellout using `"foodsubless.doc"'
shellout using `"foodsubgreater.doc"'
